import { lazy } from 'react';
import { LazyComponent } from '@/components';

// layout 组件不做懒加载
import Layout from '@/layouts';

const Home = lazy(() => import('@/pages/home'));
const Login = lazy(() => import('@/pages/login'));

export const routes = [
  {
    path: '/',
    element: LazyComponent({ lazyChildren: Layout }),
    children: [
      {
        path: '',
        element: LazyComponent({ lazyChildren: Home }),
      },
      {
        path: 'login',
        element: LazyComponent({ lazyChildren: Login }),
      },
    ],
  },
];
